package utils;
import java.sql.*;


public class DAO {
	protected	Connection connexio;
	
	public DAO() throws Exception{
		String user = "mysql";
		String password = "prac";
		Class.forName("com.mysql.jdbc.Driver").newInstance();
		connexio = DriverManager.getConnection("jdbc:mysql://localhost/ts1?user="+user+"&password="+password);
	}


	public Connection getConnexio() {
		return connexio;
	}

	public void setConnexio(Connection connexio) {
		this.connexio = connexio;
	}


	public	void	desconnectarBD() throws	SQLException{

		connexio.close();
	}
}
